import { axios } from '@/utils/http/request'
import api from './api'
import { makeFormData } from '@/utils/util'

// 获取地图城市
export function getMapCity () {
  return axios({
    url: 'medical/screenView/getHolographicMapData.jspx',
    method: 'GET'
  })
}

export function getMapJson (mapJsFile) {
  return axios({
    url: 'modules/hospital/screenView/json/' + mapJsFile + '',
    method: 'GET'
  })
}

export function getHolographicData (type, params) {
  return axios({
    url: 'medical/screenView/getHolographicData' + type + '.jspx',
    method: 'GET',
    params
  })
}

// 实时预警患者
export function getRealtimeWarnPatient () {
  return axios({
    url: 'medical/screenView/getRealtimeWarnPatient.jspx',
    method: 'GET'
  })
}

// 实时预警患者详情
export function getRealtimeWarnPatientInfo (params) {
  return axios({
    url: 'medical/screenView/getRealtimeWarnDetail.jspx',
    method: 'GET',
    params
  })
}

// 实时抓拍
export function getRealtimeCapture () {
  return axios({
    url: 'medical/screenView/getRealtimeCapture.jspx',
    method: 'GET'
  })
}

// 黑名单
export function getRealtimeBlacklist () {
  return axios({
    url: 'medical/screenView/getRealtimeBlacklist.jspx',
    method: 'GET'
  })
}

// 近7日预警
export function getRealtimeWarnAnalysis () {
  return axios({
    url: 'medical/screenView/getRealtimeWarnAnalysis.jspx',
    method: 'GET'
  })
}

// 实时监控机构树
export function getMonitorOrgListTree (params) {
  return axios({
    url: api.realTimeMonitorOrgs,
    method: 'GET',
    params: {
      ...params,
      timestamp: new Date().getTime()
    }
  })
}

// 实时监控数据总结
export function getMonitorTopStatic () {
  return axios({
    url: 'medical/screenView/getRealTimeMonitoringTop.jspx',
    method: 'GET'
  })
}

// 实时监控比对信息列表
export function getRecentPicture (data, params) {
  const formData = new FormData()
  makeFormData(data, formData)
  return axios({
    url: 'medical/device/getRecentPicture.jspx',
    method: 'POST',
    params,
    data: formData
  })
}

// 实时监控比对信息列表
export function getMonitorCompare (data) {
  const formData = new FormData()
  makeFormData(data, formData)
  return axios({
    url: 'medical/device/personCompare.jspx',
    method: 'POST',
    data: formData
  })
}

// 获取视频参数
export function getVideParam () {
  return axios({
    url: 'manage/getVideParam.jspx',
    method: 'POST'
  })
}

// 区域详情
export function zoneData (type, params = {}) {
  return axios({
    url: 'medical/screenView/getCityDetailsData' + type + '.jspx',
    method: 'GET',
    params
  })
}

// 区域地图信息
export function zoneMapData (data = {}) {
  const formData = new FormData()
  makeFormData(data, formData)
  return axios({
    url: 'medical/screenView/getCityDetailsMapData.jspx',
    method: 'POST',
    data: formData
  })
}
